<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">

<head>
	<title>个人知识库</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<!-- VENDOR CSS -->
	<link rel="stylesheet" th:href="@{/assets/vendor/bootstrap/css/bootstrap.min.css}">
	<link rel="stylesheet" th:href="@{/assets/vendor/font-awesome/css/font-awesome.min.css}">
	<link rel="stylesheet" th:href="@{/assets/vendor/linearicons/style.css}">
	<link rel="stylesheet" th:href="@{/assets/vendor/chartist/css/chartist-custom.css}">
	<!-- MAIN CSS -->
	<link rel="stylesheet" th:href="@{/assets/css/main.css}">
	<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
	<link rel="stylesheet" th:href="@{/assets/css/demo.css}">
	<!-- TOASTR -->
	<link rel="stylesheet" th:href="@{/assets/vendor/toastr/toastr.min.css}">
	<!-- CONFIRM -->
	<link rel="stylesheet" th:href="@{/assets/vendor/jquery.confirm/css/jquery-confirm.css}">
	<!-- GOOGLE FONTS -->
	<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
	<!-- ICONS -->
	<link rel="apple-touch-icon" sizes="76x76" th:href="@{/assets/img/apple-icon.png}">
	<link rel="icon" type="image/png" sizes="96x96" th:href="@{/assets/img/favicon.png}">
</head>

<body>
	<!-- WRAPPER -->
	<div id="wrapper">
		<div class="vertical-align-wrap">
			<div class="vertical-align-middle">
				<div class="auth-box ">
					<div class="left">
						<div class="content">
							<div class="header">
								<div class="logo text-center"><img th:src="@{/assets/img/logo-dark.png}" alt="Klorofil Logo"></div>
								<p class="lead">Login to your account</p>
							</div>
							<form class="form-auth-small">
								<div class="form-group">
									<label for="signin-email" class="control-label sr-only">Email</label>
									<input type="text" class="form-control" id="signin-email" value="admin" placeholder="LoginName">
								</div>
								<div class="form-group">
									<label for="signin-password" class="control-label sr-only">Password</label>
									<input type="password" class="form-control" id="signin-password" placeholder="Password">
								</div>
								<div class="form-group clearfix">
									<label class="fancy-checkbox element-left">
										<input type="checkbox">
										<span>Remember me</span>
									</label>
								</div>
								<button type="button" id="sub" class="btn btn-primary btn-lg btn-block">LOGIN</button>
								<div class="bottom">
									<span class="helper-text"><i class="fa fa-lock"></i> <a href="#">Forgot password?</a></span>
								</div>
							</form>
						</div>
					</div>
					<div class="right">
						<div class="overlay"></div>
						<div class="content text">
							<h1 class="heading">Personal knowledge management system</h1>
							<p>by The Developer</p>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>
			</div>
		</div>
	</div>
	<!-- END WRAPPER -->

	<!-- Javascript -->
	<script th:src="@{/assets/vendor/jquery/jquery.min.js}"></script>
	<script th:src="@{/assets/vendor/bootstrap/js/bootstrap.min.js}"></script>
	<script th:src="@{/assets/vendor/toastr/toastr.js}"></script>
	<script th:src="@{/assets/vendor/md5/md5.js}"></script>

	<script type="text/javascript" th:inline="javascript">
        toastr.options.positionClass = 'toast-bottom-right';

        $("#sub").click(function(){
            var username = $("#signin-email").val();
            var password = hex_md5($("#signin-password").val());
            $.ajax({
                type: 'POST',
                data: {loginname:username,password:password},
                url: '/manager/login',
                success: function(result) {
                    if(result.code == 0){
                        window.location.href = "/categorys";
                    }else{
                        toastr.error(result.msg);
                    }
                }
            });
        });
	</script>

</body>

</html>
